<template>
    <div class="boxContentCss">
            <EdCreateCard title="详情信息">
                <template #back>
                    <div class="createBack" @click="$utilsSet.goBack($router)" >
                        <svg-icon icon-class="back" /> 返回
                    </div>
                </template>
                <el-form class="width-m25" :model="form"  ref="ruleForm" label-position='right' label-width="120px">
                    <el-row :gutter="20">
                        <el-col :span="6">
                            <el-form-item label="客户信息" prop="orgId" >
                                <el-input placeholder="请输入户信息" v-model="form.orgId"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-button class="ed-button ed_black-bottom" @click="sentTask()">发起工单</el-button>
                    </el-row>
                        <el-row >
                        <el-col :span="23">
                            <el-form-item label="沟通内容" prop="content">
                                <el-input v-model="form.content" type="textarea" :resize="'none'" :rows="15" placeholder="请输入备注" maxlength="100"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row :gutter="20">
                        <el-col :span="22">
                            <el-form-item label="回复消息" prop="orgId" >
                                <el-input placeholder="请输入内容..."></el-input>
                            </el-form-item>
                        </el-col>
                        <el-button class="ed-button ed_black-bottom" @click="reply()">回复</el-button>
                    </el-row>
                </el-form>    
            </EdCreateCard>
    </div>
</template>

<script>
    import EdCreateCard from 'src/components/EdCreateCard.vue'
    import { defineComponent } from 'vue'
    import {sentTask,SendReply} from "./api.js";
    export default defineComponent({
        name: "projectCreate",
        components: { EdCreateCard},
        data(){
            return{
                form:{
                   orgId:'',
                   content:"",
                },
                
            }
        },
        mounted(){
            if(this.$route.query.id){
                this.getDetailById()
            }
        },
        methods:{
            getDetailById(){
                getDetailById({id:this.$route.query.id}).then(response => {
                    if(response.code == 20000) {
                        // this.form = response.data
                    }
                })
            }, 
           sentTask(){
               sentTask({}).then(response => {
                    if(response.code == 20000) {
                        this.form.orgId= response.data
                    }
                })
           },
           reply(){
               SendReply().then(response=>{
                   if(response.code == 20000) {
                        this.form.content= response.data
                    }
               })
           }
        }
    })
</script>

<style lang="scss" scoped>
.boxContentCss{
    position: relative;
    padding-bottom: 150px;
    .el-form{
        padding: 45px 45px 15px 15px;
    }
}
.projectButton{
    position: absolute;
    bottom:50px;
    right:50px;
    border-radius: 20px;
}
.createBack{
    margin-right: 50px;
}
</style>